C++: update test output following extractor template fix#630
Conversation
jbj
left a comment
There was a problem hiding this comment.
It seems fine to me that a type argument to a template is normalised slightly to remove a pointless const. I suppose the same will now happen for a const int argument.
What happens if there's also a G<const int *> instantiation? Does that become a separate class but with the same template argument? Or will it be the same class as G<const int *const> and have two names? And how many bodies?
|
If you add a |
|
That's probably the least bad of the two possibilities. |
dave-bartolomeo
left a comment
There was a problem hiding this comment.
Wait, what's the extractor change that causes this? G<const int*const> and G<const int*> are two different specializations of the template in C++. It's function parameters that ignore top-level const, not template arguments.
For a real-world example, std::unique_ptr<int> is an int* that gets deleted when it goes out of scope, and std::unique_ptr<const int> is a const int* that gets deleted when it goes out of scope.
|
This is not a desirable change, it's just an unfortunate side-effect of us struggling to work around an issue extracting instantiations like |
dave-bartolomeo
left a comment
There was a problem hiding this comment.
OK, it sounds like we're still keeping them as separate classes, but with top-level const incorrectly stripped from the template argument. That's still not good, but it's probably less likely to cause problems than having them as the same class. Is there a Jira ticket still open to figure out the right extractor fix post-1.19?
|
Should this be closed now? |
|
Yes, @ian-semmle figured out the correct extractor fix that keeps the correct output for this test. |
No description provided.